#include "odn_scene_SkeletalAnimation.h"
/*
namespace ouden
{
	namespace scene
	{
		
		bool ODN_AnimatedSkeleton::ODN_Animation::Update()
		{
			
			//TimeSince is the time since the last keyframe 
			long TimeSince = getTimer()->getTime() - lasttime;
			
			//If the time has gone past the duration of the current keyframe 
			if (TimeSince >= keyframes[curframe].time) {
				
				//Set the new lastkeyframetime to when the new frame started 
				lasttime = getTimer()->getTime() - (TimeSince - keyframes[curframe].time);
				
				//Increase the current frame 
				curframe++;
				
				//Check the current frame and next frame variables for the end of the animation and loop them back to the start 
				if (curframe >= framecount) 
					curframe = 0;
					
				nextframe = curframe + 1;
				
				if (nextframe >= framecount) 
					nextframe = 0;
				
			}
		
		}
			
		//Returns the animated position of a specified point 
		//TODO: Check if should return ODN_Point 
		Vector3D ODN_AnimatedSkeleton::ODN_Animation::getCurrentPointPos(int PointIndex)
		{
			
			//TimeSince is the time since the last keyframe 
			long TimeSince = getTimer()->getTime() - lasttime;
			
			//Quick frame position variables 
			Vector3D ThisFramePos = keyframes[curframe].points[PointIndex];
			Vector3D NextFramePos = keyframes[nextframe].points[PointIndex];
			
			//Interpolate the keyframes over the time since the last one 
			Vector3D Pos = ThisFramePos + TimeSince / keyframes[curframe].time * (NextFramePos - ThisFramePos);
			
			//Return the calculated position of the point 
			return Pos;
			
		}
		
		//Loads an animation from a file 
		bool ODN_AnimatedSkeleton::ODN_Animation::loadAnimation(char* Filename)
		{
			
			
			
		}
		
	} //namespace scene 
} //namespace ouden 
*/

